﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using CommunityServer.WebServices.MediaGalleries;

namespace nb.development.csmediamanager
{
    public partial class MultiAttachmentPicker : UserControl
    {
        public MultiAttachmentPicker()
        {
            InitializeComponent();
        }

        public string AttachmentButtonText
        {
            get { return attachmentPicker.Text; }
            set { attachmentPicker.Text = value; }
        }

        public bool Uploaded
        {
            get { return attachmentPicker.Uploaded; }
        }

        public Guid SiteId
        {
            get { return attachmentPicker.SiteId; }
            set { attachmentPicker.SiteId = value; }
        }

        public MediaGallery Gallery
        {
            get { return attachmentPicker.Gallery; }
            set { attachmentPicker.Gallery = value; }
        }

        public string Filename
        {
            get { return attachmentPicker.Filename; }
        }

        public Guid TemporaryGuid
        {
            get { return attachmentPicker.TemporaryGuid; }
        }

        public event MouseEventHandler DeleteClicked;
        public event TemporaryMediaUploaded UploadCompleted;

        private void attachmentPicker_UploadCompleted(object sender)
        {
            if (UploadCompleted != null) UploadCompleted(this);
        }

        private void btnDelete_MouseClick(object sender, MouseEventArgs e)
        {
            if (DeleteClicked != null && e.Button == MouseButtons.Left)
                DeleteClicked(this, e);
        }
    }
}
